This scenario verifies which hosting assets are visible to a user whose JWT contains a GROUP Subject.
GrantOfProjectAdminRoleToGroupSubject from 9520:
Granting a Project Admin Role to a Group| name | value |
|---|---|
| nameOfGroupSubject | /xyz-Service |
| nameOfUserSubject | tst-drew_selfregistered |
| projectCaption | D-1000111 default project |
In a real-world scenario, there could be multiple results and the user has to select the correct one.
HTTP GET "/api/hs/booking/projects" \
-H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
`# {` \
`# "comment" : "any user which does not even need to have any roles granted yet",` \
`# "sub" : "uuid<tst-drew_selfregistered>",` \
`# "groups" : [` \
`# "/xyz-Service"` \
`# ]` \
`# }`
=> status: 200 OK
[ {
"uuid" : "59a8690d-244f-4df5-9e03-67321fae593c", // projectUuid
"caption" : "D-1000111 default project"
} ]
The group ‘/xyz-Service’ has the role ‘hs_booking.project#59a8690d-244f-4df5-9e03-67321fae593c:ADMIN’. // projectUuid The user ‘tst-drew_selfregistered’ is a member of the group ‘/xyz-Service’. Therefore, hosting assets below the booking project ‘D-1000111 default project’ are expected to be visible.
HTTP GET "/api/hs/hosting/assets?projectUuid=59a8690d-244f-4df5-9e03-67321fae593c" // projectUuid \
-H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
`# {` \
`# "comment" : "any user which does not even need to have any roles granted yet",` \
`# "sub" : "uuid<tst-drew_selfregistered>",` \
`# "groups" : [` \
`# "/xyz-Service"` \
`# ]` \
`# }` \
-H 'Hostsharing-Assumed-Roles: hs_booking.project#59a8690d-244f-4df5-9e03-67321fae593c:ADMIN' // projectUuid
=> status: 200 OK
[ {
"uuid" : "af838348-b9e7-4888-ac73-79fb08dd2fb5",
"type" : "MANAGED_WEBSPACE",
"identifier" : "fir01",
"caption" : "some Webspace",
"alarmContact" : null,
"config" : { }
}, {
"uuid" : "66013bff-df51-4476-adc7-f98b25d470cf",
"type" : "MANAGED_SERVER",
"identifier" : "vm1011",
"caption" : "some ManagedServer",
"alarmContact" : null,
"config" : {
"monit_max_ram_usage" : 80,
"monit_max_ssd_usage" : 70,
"monit_max_cpu_usage" : 90
}
} ]
generated on 2026-08-10 01:37:50 for branch